@charset "UTF-8";

// 绝对居中
@mixin absCenter() {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

// 清除浮动
@mixin clearFloat() {
	&:before,
	&:after {
		content: "";
		clear: both;
		display: block;
		height: 0;
		overflow: hidden;
	}
}

// 纸张阴影效果
// $depth: 阴影深度（1-4，默认为1）
@mixin buildShadow($depth: 1, $color: #000) {
	$y1: 1px;
	$y2: 1px;

	$blur1: 2px;
	$blur2: 3px;

	$spread1: 0;
	$spread2: 0;

	@if $depth == 2 {
		$y2: 2px;

		$blur1: 4px;
		$blur2: 6px;
	} @else if $depth == 3 {
		$y2: 5px;

		$blur1: 6px;
		$blur2: 10px;
	} @else if $depth >= 4 {
		$y1: 2px;
		$y2: 8px;

		$blur1: 8px;
		$blur2: 20px;

		$spread1: 1px;
		$spread2: 2px;
	}

	box-shadow: 0 $y1 $blur1 $spread1 rgba($color, 0.07),
				0 $y2 $blur2 $spread2 rgba($color, 0.1);
}
